#include<iostream>
#include<memory>
#include"Tcp_sever.hpp"
#include"comend_excute.hpp"
void Usage(char * str)
{
    std::cout<<"Usage:\n\t"<<str<<"lock_port\n"<<std::endl;
}
int main(int argc,char*argv[])
 {
    if(argc != 2)
    {
        Usage(argv[0]);
        return 1;
    }
    uint16_t port = std::stoi(argv[1]);
    command  cmd("./safe.txt");
    func_t cmdExecte = std::bind(&command::Excute,&cmd,std::placeholders::_1);
    std::unique_ptr<TcpServer> tsvr = std::make_unique<TcpServer>(port,cmdExecte);
    tsvr->Initserver();
    tsvr->Loop();
    return 0;
 }